package cn.com.ejiakanghu.vo;

import org.linlinjava.litemall.db.domain.AgedmallAgentSettleDetail;
import org.linlinjava.litemall.db.domain.LitemallOrder;
import org.linlinjava.litemall.db.util.DateUtil;
import org.linlinjava.litemall.db.util.OrderUtil;
import org.linlinjava.litemall.db.vo.app.AppAgentSettleDetail;

import java.math.BigDecimal;
import java.util.List;

public class SettleOrderListVo {
    private String bigOrderId;
    private String subOrderId;
    private Integer subOrderStatus;
    private BigDecimal subOrderPrice;
    private Integer proxyStatus;
    private BigDecimal proxyPrice;
    private String proxyTime;
    private List<SubOrderGoodsVo> subOrderGoodsList;
    private Integer isCredit;

    public static SettleOrderListVo getInstance(AppAgentSettleDetail appAgentSettleDetail, LitemallOrder bigOrder, LitemallOrder order, List<SubOrderGoodsVo> subOrderGoodsList) {
        SettleOrderListVo settleOrderListVo = new SettleOrderListVo();
        //settleOrderListVo.setBigOrderId(appAgentSettleDetail.getBigOrderSn());
        settleOrderListVo.setSubOrderId(appAgentSettleDetail.getSubOrderSn());
        settleOrderListVo.setSubOrderStatus(OrderUtil.showType(order.getOrderStatus()));
        settleOrderListVo.setSubOrderPrice(order.getOrderPrice());
        settleOrderListVo.setProxyStatus(appAgentSettleDetail.getProxyStatus().intValue());
        settleOrderListVo.setProxyPrice(appAgentSettleDetail.getProxyPrice());
        settleOrderListVo.setProxyTime(null == appAgentSettleDetail.getProxyTime() ? null : appAgentSettleDetail.getProxyTime().format(DateUtil.DATE_TIME_FORMATTER));
        settleOrderListVo.setSubOrderGoodsList(subOrderGoodsList);
        settleOrderListVo.setIsCredit(bigOrder.getIsCredit());
        return settleOrderListVo;
    }

    public String getBigOrderId() {
        return bigOrderId;
    }

    public void setBigOrderId(String bigOrderId) {
        this.bigOrderId = bigOrderId;
    }

    public String getSubOrderId() {
        return subOrderId;
    }

    public void setSubOrderId(String subOrderId) {
        this.subOrderId = subOrderId;
    }

    public Integer getSubOrderStatus() {
        return subOrderStatus;
    }

    public void setSubOrderStatus(Integer subOrderStatus) {
        this.subOrderStatus = subOrderStatus;
    }

    public BigDecimal getSubOrderPrice() {
        return subOrderPrice;
    }

    public void setSubOrderPrice(BigDecimal subOrderPrice) {
        this.subOrderPrice = subOrderPrice;
    }

    public Integer getProxyStatus() {
        return proxyStatus;
    }

    public void setProxyStatus(Integer proxyStatus) {
        this.proxyStatus = proxyStatus;
    }

    public BigDecimal getProxyPrice() {
        return proxyPrice;
    }

    public void setProxyPrice(BigDecimal proxyPrice) {
        this.proxyPrice = proxyPrice;
    }

    public String getProxyTime() {
        return proxyTime;
    }

    public void setProxyTime(String proxyTime) {
        this.proxyTime = proxyTime;
    }

    public List<SubOrderGoodsVo> getSubOrderGoodsList() {
        return subOrderGoodsList;
    }

    public void setSubOrderGoodsList(List<SubOrderGoodsVo> subOrderGoodsList) {
        this.subOrderGoodsList = subOrderGoodsList;
    }

    public Integer getIsCredit() {
        return isCredit;
    }

    public void setIsCredit(Integer isCredit) {
        this.isCredit = isCredit;
    }
}
